package xu.zhi.qing.share.dao;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import xu.zhi.qing.common.dao.BaseDao;
import xu.zhi.qing.share.entity.Share;

import java.util.List;
import java.util.Map;

@Repository
public interface ShareDao extends BaseDao<Share> {

    /**
     * 点赞榜
     * @return
     */
    List<Share> findByLikeRankingAndPage(Map<String, Object> params);

    Integer countByLikeRankingAndPage(Map<String, Object> params);

    /**
     * 查找分享
     * @param params 查找分享的条件
     * @return
     */
    List<Share> findPagination(Map<String, Object> params);

    Integer countByMap(Map<String, Object> params);

    List<Share> findByUserId(@Param("userId") Integer userId);

    Integer countByUserId(@Param("userId") Integer userId);

}
